﻿namespace FindLatestFile;

public partial class App : PrismApplication
{
    public static string ApplicationName => "文件比对工具";

    public App()
    {
        ApplicationBase.Initialize();
    }

    protected override void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterSingleton<IAppSettingsBase, AppSettings>();
        containerRegistry.RegisterSingleton<IAppSettings, AppSettings>();
    }

    protected override Window CreateShell()
    {
        var settings = Container.Resolve<IAppSettings>();
        settings.LoadConfig();
        IocManage.Container = Container;
        IocManage.Settings = settings;
        IocManage.Aggregator = Container.Resolve<IEventAggregator>();

        return Container.Resolve<MainWindow>();
    }
}